/**
 * 
 */
package environment;

import javax.vecmath.Vector3d;
import javax.vecmath.Vector3f;

import program.MovingObjects;
import robot.DaggensRobot;
import robot.Robot;
import simbad.sim.BallAgent;
import simbad.sim.Box;
import simbad.sim.EnvironmentDescription;

/**
 * @date 8 maj 2012
 * @version 1.0
 */
public class DaggensEnv extends EnvironmentDescription {
	
	public static float boxSize = 0.9f;
	public static Vector3f boxVector = new Vector3f(boxSize,boxSize,boxSize);
	
	public DaggensEnv () {
		
		MovingObjects mo = new MovingObjects();
		this.setUsePhysics(true);
		Robot r2 = new DaggensRobot(new Vector3d(0,0,5), "Robot", mo);

		this.showAxis(true);
		this.setUsePhysics(true);
		add(r2);
		add(new BallAgent(new Vector3d(2,0,-5), "boll", 0.5f));
		int num = 2;

		switch (num) {
			case 0 : 
				//Empty
			break;
				
			case 1 :
				//Simple map
				add(new Box(new Vector3d(-2,0,0), boxVector, this));
				add(new Box(new Vector3d(-3,0,-1), boxVector, this));
				add(new Box(new Vector3d(-3,0,-2), boxVector, this));
				add(new Box(new Vector3d(0,0,1), boxVector, this));
				add(new Box(new Vector3d(1,0,0), boxVector, this));
				add(new Box(new Vector3d(1,0,-1), boxVector, this));
				add(new Box(new Vector3d(-1,0,0), boxVector, this));
			break;
			
			case 2 : 
				for(int i = -10; i <= 10; i++) {
					add(new Box(new Vector3d(i,0,10), boxVector, this));
					add(new Box(new Vector3d(i,0,-10), boxVector, this));
					add(new Box(new Vector3d(10,0,i), boxVector, this));
					add(new Box(new Vector3d(-10,0,i), boxVector, this));
				}
				
				for(int i = 2; i < 10; i++) {
					add(new Box(new Vector3d(-i,0,0), boxVector, this));
				}
					
				for(int i = 1; i < 8; i++) {
					add(new Box(new Vector3d(1,0,i), boxVector, this));
					add(new Box(new Vector3d(-1,0,i), boxVector, this));
					add(new Box(new Vector3d(1,0,-i), boxVector, this));
					add(new Box(new Vector3d(-1,0,-i), boxVector, this));
				}
				add(new Box(new Vector3d(0,0,-8), boxVector, this));
				
				add(new Box(new Vector3d(-1,0,0), boxVector, this));
				add(new Box(new Vector3d(0,0,2), boxVector, this));
				add(new Box(new Vector3d(1,0,0), boxVector, this));
				break;
		}
	}
	
	
}
